<?php

# PMB Online
# Aplikasi PMB Online untuk Pendaftaran Calon Mahasiswa di PT/PTS Indonesia
# 
# version 1.0
# class gel_view
# file
# created Feb 5, 2013 9:07:48 PM
# 
# (c)2012, arif.laksito@gmail.com

if (!defined('BASEPATH'))
    exit('No direct script access allowed');
?>

<script>
$(function() {
<?php foreach ($gel as $s): ?>                
    $("#dialog_<?php echo $s['id_gel']?>").hide();    
    $("#confirm_<?php echo $s['id_gel'] ?>").click(function(){
        $("#dialog_<?php echo $s['id_gel'] ?>").dialog({            
            height:200,
            modal: false,
            buttons: {
                "Delete": function() {
                    window.location = "<?php echo base_url().'apps/gel_delete/'.$s['id_gel']?>";
                    $( this ).dialog( "close" );
                },
                Cancel: function() {
                    $( this ).dialog( "close" );
                }
            }
        });
    });
<?php endforeach; ?>                                        
});
</script>

<?php foreach ($gel as $h): ?>
    <div id="dialog_<?php echo $h['id_gel'] ?>" title="Hapus Gelombang?">
        <p style="font-size: 12px">
            <span style="font-size: 24px; float: left; margin: 0 7px 50px 0;"><i class="icon-warning-sign"></i></span>
            Data "<?php echo $h['nama_gel']?>" akan dihapus, pastikan tidak ada transaksi pada data tersebut
        </p>
    </div>
<?php endforeach; ?>

<h3>Gelombang PMB</h3>
<ul class="breadcrumb">
    <li>PMB Online <span class="divider">/</span></li>  
    <li>Data Master <span class="divider">/</span></li>
    <li>Gelombang PMB</li>
</ul>

<?php if ($msg!=''): ?>
    <div class="<?php echo ($sts) ? 'alert alert-success' : 'alert alert-error' ?>">
        <?php echo $msg ?>
    </div>
<?php endif ?>

<p>
    <?php echo anchor('apps/gel_add', '<i class=icon-plus-sign></i> Tambah Gelombang', 'class="btn btn-small btn-success"') ?>
</p>

<table class="table table-condensed table-hover">
    <tr>
        <th>No</th>               
        <th>Nama Gelombang</th>        
        <th>Tanggal Mulai</th>        
        <th>Tanggal Selesai</th>        
        <th>Tanggal Akhir Bayar</th>        
        <th></th>    
    </tr>
    <?php $i=1?>
    <?php foreach($gel as $g):?>
    <tr>
        <td><?php echo $i?></td>
        <td><?php echo $g['nama_gel']?></td>
        <td><?php if($g['start_gel']!='') echo mdate('%d %M %Y',mysql_to_unix($g['start_gel']))?></td>
        <td><?php if($g['end_gel']!='') echo mdate('%d %M %Y',mysql_to_unix($g['end_gel']))?></td>
        <td><?php if($g['end_bayar']!='') echo mdate('%d %M %Y',mysql_to_unix($g['end_bayar']))?></td>
        <td>
            <?php echo anchor('apps/gel_edit/' . $g['id_gel'], '<i class=icon-edit></i>') ?>&nbsp;&nbsp;&nbsp;
            <a href="#" id="confirm_<?php echo $g['id_gel'] ?>"><i class="icon-remove"></i></a>
        </td>
    </tr>
    <?php $i++?>
    <?php endforeach?>
</table>    